using System;
using System.Configuration.Provider;

namespace ImageProvider
{
    public class ImageProviderCollection : ProviderCollection
    {
        public new ImageProviderBase this[string name]
        {
            get { return (ImageProviderBase)base[name]; }
        }

        public override void Add(ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (provider is ImageProviderBase == false)
            {
                throw new ArgumentException("Invalid provider type", "provider");
            }

            base.Add(provider);
        }
    }
}